<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" template="/masterPage.xhtml">
	<ui:define name="content">
		<h:form id="shops_form">
			<p:toolbar id="toolbar"  style="margin-top:20px; margin-bottom:5px">
				<p:toolbarGroup align="left">
					<p:commandButton value="New Shop"
						action="#{shopsBean.showDialog}" style="font-size: 85% !important" />
				</p:toolbarGroup>
			</p:toolbar>

			<p:dataTable id="shopsTable" var="shop"
				value="#{shopsBean.shops}" rowKey="#{shop.id}"
				selection="#{shopsBean.selectedShop}" selectionMode="single">
				<p:column id="shop_id" headerText="ID" sortBy="#{shop.id}">
					<h:outputText value="#{shop.id}" />
				</p:column>
				<p:column id="shop_name" headerText="Shop's name">
					<h:outputText value="#{shop.name}" />
				</p:column>
				<p:column id="shop_webSite" headerText="Shop's web site">
					<h:outputText value="#{shop.webSite}" />
				</p:column>
				<p:column id="shop_description" headerText="Shop's description">
					<h:outputText value="#{shop.description}" />
				</p:column>
			</p:dataTable>
		</h:form>
		<h:form id="newShopDialog_form">
			<p:dialog id="newShopDialog" header="New Shop"
				widgetVar="newShopDialog" modal="true">
				<ui:include src="dialogs/newShopDialog.xhtml" />
			</p:dialog>
		</h:form>
	</ui:define>
</ui:composition>
